package com.seal.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.seal.dao.INoteInfoDao;
import com.seal.model.NoteInfo;
import com.seal.service.INoteInfoService;

@Service("noteInfoServiceImpl")
@Transactional(readOnly = true)
public class NoteInfoServiceImpl implements INoteInfoService {

	@Resource(name = "noteInfoDaoImpl")
	private INoteInfoDao noteInfoDao;

	@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackForClassName = "Exception")
	public void addNoteInfo(NoteInfo ca) throws Exception {
		noteInfoDao.addNoteInfo(ca);
	}

	public NoteInfo getNoteInfo(Long busiNo, String userId) throws Exception {
		return noteInfoDao.getNoteInfo(busiNo, userId);
	}

	@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackForClassName = "Exception")
	public void updateNoteInfo(NoteInfo ca) throws Exception {
		noteInfoDao.updateNoteInfo(ca);
	}

	public NoteInfo getNoteInfoById(Long id) throws Exception {
		return noteInfoDao.getNoteInfoById(id);
	}

	public List<NoteInfo> getNoteInfoList(String busiNos, String userId)
			throws Exception {
		return noteInfoDao.getNoteInfoList(busiNos, userId);
	}
}
